package com.bjwl.wybx.service.impl;


import com.bjwl.wybx.entity.Notice;
import com.bjwl.wybx.mapper.NoticeMapper;
import com.bjwl.wybx.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {
    @Autowired
    private NoticeMapper noticeMapper;
    @Override
    public int add(Notice notice) {
        return noticeMapper.add(notice);
    }

    @Override
    public List<Notice> queryByRoId(Integer ro_id) {
//        List<String> list=new ArrayList<>();
        List<Notice> noticeList=noticeMapper.queryByRoId(ro_id);
//        for (Notice notice:noticeList
//             ) {
//            list.add(notice.getNotice_desc());
//        }
        return noticeList;
    }

    @Override
    public Notice queryOne(Integer notice_id) {
        //调用dao层查询某一条公告的方法
        Notice notice = noticeMapper.queryOne(notice_id);
        return notice;
    }

    @Override
    public int update(Notice notice) {
        return noticeMapper.update(notice);
    }

<<<<<<< HEAD
    @Override
    public List<Notice> getNoticeDataList() {
        return noticeMapper.getNoticeDataList();
    }

=======
>>>>>>> 70f7e19d6da4b30f0412d394b1171a015e63af36
}
